package com.qf.pickname.controller;

import com.qf.pickname.entity.Student;
import com.qf.pickname.service.StudentService;
import com.qf.pickname.utils.StudentDataStore;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Random;

@RestController
public class StudentController {

    // 需要通过spring注解实现下面属性的赋值操作
    @Autowired  // 自动配置
    private StudentService studentService;

    @RequestMapping("/pickname")
    public Student pickname(){

        Student student = studentService.randomStudent();

        return student;
    }

}
